Copyright: Copyright © 1994 Global Majic Software, Inc.
Citation: Copyright © 1994 Global Majic Software, Inc.


Contents
Global Majic Software, Inc.

Instrumentation Custom Control Library

Toggle Switch Control

Properties	Evens	Product Support	Copyright

Description:

Toggle Switch Control is a TRUE/FALSE, YES/NO or ON/OFF indicator.  The control displays captions or pictures to represent the toggle state depending on the control's value.  The control is capable of playing wave files to indicate the switch turning on or off.  It includes bevels for a 3D appearance and blinking capability to draw attention to the control.  It also has a built in timed shut-off capability.

Remarks:

Wave files used with the control will not be stored in the control as the bitmap files are, therefore, all wave files need to accompany your application.  Be carefull with using many timers and blinking controls on a single form because windows has a limited number of timer handles.


Product Support

Product support for Instrumentation Custom Control Library is available to registered users by contacting Global Majic Software, Inc. at the following locations:

Global Majic Software, Inc.

P.O. Box 322

Madison, Alabama  35758

CompuServe:  73261,3642

Internet:   73261.3642@compuserve.com

Product Support is free for a period of three (3) months from the date of registration.


BevelOuter
BevelOuter Property

Description

Sets or returns the outer shadow style of the control.

Usage

[form.]control.BevelOuter[ = integer ]

Setting

The BevelOuter property settings are:

Setting 	Description

0	None

1	Raised

2	Inset

Remarks

This property has no affect when BevelWidth=0.  This property is used in conjunction with BevelInner, BevelWidth, and BorderWidth.

Data Type

Integer (Enumerated)


BevelInner
BevelInner Property

Description

Sets or returns the inner shadow style of the control.

Usage

[form.]control.BevelInner[ = integer ]

Setting

The BevelInner property settings are:

Setting 	Description

0	None

1	Raised

2	Inset

Remarks

This property has no affect when BevelWidth=0.  This property is used in conjunction with BevelOuter, BevelWidth, and BorderWidth.

Data Type

Integer (Enumerated)


BevelWidth
BevelWidth Property

Description

Sets or returns the shadow sizes of the inner and outer bevels of the control.

Usage

[form.]control.BevelWidth[ = integer ]

Remarks

This property works in conjunction with BevelInner, BevelOuter and BorderWidth.

Data Type

Integer


BorderWidth
BorderWidth Property

Description

Sets or returns the border size between the inner and outer bevels of the control.

Usage

[form.]control.BorderWidth[ = integer ]

Remarks

This property works in conjunction with BevelInner, BevelOuter and BevelWidth.

Data Type

Integer


MouseControl
MouseControl Property

Description

Enables and disables mouse input to the control.

Usage

[form.]control.MouseControl[ = {TRUE|FALSE} ]

Setting

The MouseControl property settings are:

Setting 	Description

True	Allows the control's Value to be modified with mouse input.

False	Disables mouse input to the control.

Data Type

Integer (Boolean)


Value
Value Property

Description

Sets or returns the control's displayed value.

Usage

[form.]control.Value[ = {TRUE|FALSE} ]

Remarks

The OnPicture is displayed when the toggle control's value = TRUE and the OffPicture is displayed when the toggle control's value = FALSE.  When the toggle control's value is changed to FALSE, the OffWave wave file is played and when the toggle control's value is changed to TRUE, the OnWave wave file is played.

Data Type

Integer (Boolean)


copyright
COPYRIGHT INFORMATION

All Global Majic Software, Inc. software programs, shareware, and freeware are protected under the copyright laws of the United States and foreign countries. All rights are reserved to Global Majic Software, Inc. Violations of copyright laws are investigated by the FBI. Distribution of Global Majic Software, Inc. products implies that you have read and agreed to the distribution terms described below:

INTENT

Global Majic Software, Inc. seeks to distribute its shareware as widely as possible. However, we want the end-users of our software to be properly informed that it is shareware.

DISTRIBUTOR INFORMATION AND LICENSE INFORMATION

The license information and distribution requirements in this document supersede all previous license statements. To continue to distribute Global Majic Software, Inc. products, you must adhere to the licensing and distribution requirements below.

If you are a mail order or BBS-type distributor of shareware software, you may distribute these programs as they are, without any changes other than expanding files contained in the ZIP archives. However, you have the responsibility to check from time to time, at a minimum interval of 6 months, for new versions of these programs, and to update your copies in a timely manner. Global Majic Software, Inc. will gladly send you a diskette containing the current versions on request.

You must fully identify all Global Majic Software, Inc. programs in your advertising, by the program's full name and version, and indicate the registration fee in the program description. The words Global Majic Software, Inc. must appear in all program descriptions.

SHAREWARE DISCLOSURE REQUIRED

All advertising and packaging information including references to Global Majic Software, Inc. products must contain a statement explaining the shareware concept.  Specifically, that statement must explain that shareware software MUST be registered by the user, after a trial period, by paying a registration fee, and that all monies paid for the shareware version are duplication and distribution charges only. All such statements must be clearly displayed in a position where they are likely to be read by potential customers.

RETAIL RACK AND CD-ROM DISTRIBUTION

If you distribute shareware in a retail setting in racks, store displays, vending machines, at computer fairs, or in any way other than normal BBS or catalog-based sales, you must contact Global Majic Software, Inc. for permission to distribute any Global Majic Software, Inc. program. Rack or retail-like sales require a special distribution license, normally requiring royalties paid to Global Majic Software, Inc. If you distribute shareware on CD-ROM disks, you must also contact Global Majic Software, Inc. before including any Global Majic Software, Inc. shareware programs on a CD-ROM disk. Normally, permission is granted, but current versions must be included and all old versions of any Global Majic Software, Inc. program removed from any CD-ROM disk containing Global Majic Software, Inc. products.


OnWave
OnWave Property

Description

Determines the wave file to be played when the toggle control's value is set to TRUE.

Usage

[form.]control.OnWave[ = filename ]

Remarks

When setting the wave file at design-time, the wave file will not be saved with the form or compiled into the executable.  Wave files need to accompany executables.  All sounds from the control can be disabled by setting Sound = FALSE.

Data Type

String


OnPicture
OnPicture Property

Description

Determines the graphic to be displayed when the toggle control's value = TRUE.

Usage

[form.]control.OnPicture[ = picture ]

Setting

The OnPicture property settings are:

Setting 	Description

(none)	No picture is displayed.

(bitmap)	At design-time, specify the bitmap file name to be displayed.  At run-time, specify the bitmap using the LoadPicture function.

Remarks

When setting the picture at design-time, the picture will be saved with the form, and will be compiled into the executable.  When AutoSize = FALSE, the picture is stretched to fit the controls dimensions, set AutoSize = TRUE to display the picture in its full size.

Data Type

Integer


OffWave
OffWave Property

Description

Determines the wave file to be played when the toggle control's value is set to FALSE.

Usage

[form.]control.OffWave[ = filename ]

Remarks

When setting the wave file at design-time, the wave file will not be saved with the form or compiled into the executable.  Wave files need to accompany executables.  All sounds from the control can be disabled by setting Sound = FALSE.

Data Type

String


AutoSize
AutoSize Property

Description

Enables the control to automatically size itself to fit its contents.

Usage

[form.]control.AutoSize[ = {TRUE|FALSE} ]

Setting

The AutoSize property settings are:

Setting 	Description

TRUE	Automatically sizes itself to fit its contents.

FALSE	Allows the width and height of the control to be set manually.

Data Type

Integer (Boolean)


OffBackColor
OffBackColor Property

Description

Determines the background color of the toggle control when it is Off (Value = 0) .

Usage

[form.]control.OffBackColor[ = color ]

Remarks

This property can be set using the RGB or QBColor functions.

Data Type

Long.


ToggleProperties
Properties:

AutoSize	Index	OnX
BackColor	Left	OnY
BevelInner	MouseControl	Outline
BevelOuter	MousePointer	OutlineColor
BevelWidth	OffBackColor	PushPicture
BlinkMode	OffCaption	PushX
BlinkRate	OffForeColor	PushY
BorderWidth	OffPicture	Sound
Enabled	OffWave	TabIndex
FontBold	OffX	TabStop
FontItalic	OffY	Tag
FontName	OnBackColor	Top
FontSize	OnCaption	TwoState
FontStrikethru	OnForeColor	Value
FontUnderline	OnPicture	Visible
Height	OnTimer	Width
HelpContextID	OnWave


BlinkMode
BlinkMode Property

Description

Determines the mode in which the toggle control blinks.

Usage

[form.]control.BlinkMode[ = integer ]

Setting

The BlinkMode property settings are:

Setting 	Description

0 (Never)	The toggle switch never blinks.

1 (Always)	The toggle switch always blinks.

2 (When On)	The toggle switch blinks only when the switch is On.

3 (When Off)	The toggle switch blinks only when the switch is Off.

Remarks

This property has no affect when BlinkRate = 0.

Data Type

Integer (Enumerated)


OffPicture
OffPicture Property

Description

Determines the graphic to be displayed when the toggle control's value = FALSE

Usage

[form.]control.OffPicture[ = picture ]

Setting

The OffPicture property settings are:

Setting 	Description

(none)	No picture is displayed.

(bitmap)	At design-time, specify the bitmap file name to be displayed.  At run-time, specify the bitmap using the LoadPicture function.

Remarks

When setting the picture at design-time, the picture will be saved with the form, and will be compiled into the executable.  When AutoSize = FALSE, the picture is stretched to fit the controls dimensions.  Set AutoSize = TRUE to display the picture in its full size.

Data Type

Integer


OffY
OffY Property

Description

Defines a vertical offset of the OffCaption from the center of the toggle control.  This property only applies when OffPicture is not defined and the Toggle control is off  (value = FALSE).

Usage

[form.]control.OffY[ = Pixels ]

Remarks

The default settings for this property is 0.

Data Type

Integer.


Sound
Sound Property

Description

Enables the control to play wave files when its value is changed.

Usage

[form.]control.Sound[ = {TRUE|FALSE} ]

Setting

The Sound property settings are:

Setting 	Description

TRUE	Enables the control to play wave files.

FALSE	Disables the control from playing wave files.

Data Type

Integer (Boolean)


BlinkRate
BlinkRate Property

Description

Determines the rate (int milliseconds) at which the toggle control blinks.

Usage

[form.]control.BlinkRate[ = milliseconds ]

Remarks

This property works in conjunction with BlinkMode to determine the blinking characteristics of the toggle control.  When the BlinkRate = 0, the toggle control will not blink.

Data Type

Integer


OnY
OnY Property

Description

Defines a vertical offset of the OnCaption from the center of the toggle control.  This property only applies when OnPicture is not defined and the Toggle control is off  (value = TRUE).

Usage

[form.]control.OnY[ = Pixels ]

Remarks

The default settings for this property is 0.

Data Type

Integer.


OffForeColor
OffForeColor Property

Description

Determines the foreground color used to display text for the toggle control when it is Off (Value = 0) .

Usage

[form.]control.OffForeColor[ = color ]

Remarks

This property can be set using the RGB or QBColor functions.

Data Type

Long.


OnBackColor
OnBackColor Property

Description

Determines the background color of the toggle control when it is On (Value = 1) .

Usage

[form.]control.OnBackColor[ = color ]

Remarks

This property can be set using the RGB or QBColor functions.

Data Type

Long.


OnForeColor
OnForeColor Property

Description

Determines the foreground color used to display text for the toggle control when it is On (Value = 1) .

Usage

[form.]control.OnForeColor[ = color ]

Remarks

This property can be set using the RGB or QBColor functions.

Data Type

Long.


OffCaption
OffCaption Property

Description

Determines the text displayed on the toggle control when it is off  (value = 0).

Usage

[form.]control.OffCaption[ = stringexpression ]

Remarks

The default settings for this property is "Off".

Data Type

String


OnCaption
OnCaption Property

Description

Determines the text displayed on the toggle control when it is on  (value = 1).

Usage

[form.]control.OnCaption[ = stringexpression ]

Remarks

The default settings for this property is "On".

Data Type

String


OnTimer
OnTimer Property

Description

Determines the how long (in milliseconds) the toggle control will remain on (Value = 1).

Usage

[form.]control.OnTimer[ = milliseconds ]

Remarks

When OnTimer = 0, the toggle control will not automatically turn itself off (Value = 0).

Data Type

Integer


OnX
OnX Property

Description

Defines a horizontal offset of the OnCaption from the center of the toggle control.  This property only applies when OnPicture is not defined and the Toggle control is off  (value = TRUE).

Usage

[form.]control.OnX[ = Pixels ]

Remarks

The default settings for this property is 0.

Data Type

Integer.


OffX
OffX Property

Description

Defines a horizontal offset of the OffCaption from the center of the toggle control.  This property only applies when OffPicture is not defined and the Toggle control is off  (value = FALSE).

Usage

[form.]control.OffX[ = Pixels ]

Remarks

The default settings for this property is 0.

Data Type

Integer.


Outline
Outline Property

Description

Enables an outline with color OutlineColor to be painted arounf the border of the control.

Usage

[form.]control.Outline[ = {TRUE|FALSE} ]

Setting

The Outline property settings are:

Setting	Description

TRUE	Outline is painted

FALSE	Outline is not paintes.

Data Type

Integer.(Boolean)


OutlineColor
OutlineColor Property

Description

Determines the Outline color of the control.

Usage

[form.]control.OutlineColor[ = color ]

Remarks

This property can be set using the RGB or QBColor functions.

Data Type

Long.


PushPicture


PushX
PushX Property

Description

Defines a horizontal offset of the OnCaption or OffCaption from the center of the toggle control while the left mouse button is pressed.  This property only applies when OnPicture or OffPicture is not defined.

Usage

[form.]control.PushX[ = Pixels ]

Remarks

The default settings for this property is 0.

Data Type

Integer.


PushY
PushY Property

Description

Defines a vertical offset of the OnCaption or OffCaption from the center of the toggle control while the left mouse button is pressed.  This property only applies when OnPicture or OffPicture is not defined.

Usage

[form.]control.PushY[ = Pixels ]

Remarks

The default settings for this property is 0.

Data Type

Integer.


TwoState
TwoState Property

Description

Determines the bevel display mode of the toggle control.  When enabled, this property allows the toggle to behave as a two-state button.

Usage

[form.]control.TwoState[ = {TRUE|FALSE} ]

Setting

The TwoState property settings are:

Setting	Description

TRUE	Bevels swap defined raised or inset states depending on the control's Value.

FALSE	Bevels always remain in defined raised or inset states regardless of the control's Value.

Data Type

Integer.(Boolean)


ToggleEvents
Events

Click

DragDrop

GotFocus

LostFocus

MouseDown

MouseMove

MouseUp